<template>
  <div>
    <input type="file" @change="onChange" />
  </div>
</template>

<script setup lang="ts">
import { getFileChunksAndHash } from "./utils";

const onChange = (event: Event) => {
  const file = (event.target as HTMLInputElement).files?.[0]!;

  getFileChunksAndHash(file)
    .then((result) => {
      console.log("chunkList", result.chunkList);
      console.log("hash", result.hash);
    })
    .catch((error) => {
      console.log("失败了", error);
    });
};
</script>
